<?php

use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\ExcelPd */

$title = ($type == 'pdf') ? 'PD复诊' : strtoupper($type);
$this->title = '更新'.$title.'表格';
$this->params['breadcrumbs'][] = ['label' => '临床信息', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => '门诊表格', 'url' => ['/clinical/excel']];
$this->params['breadcrumbs'][] = $this->title;

/* @var $this yii\web\View */
/* @var $model app\models\ExcelPd */
$this->registerJsFile('@web/js/excel.js?v=1', ['depends' => 'app\assets\AppAsset']);
?>

<?= Breadcrumbs::widget([
    'homeLink' => ['label' => '医疗管理系统', 'url' => '#'],
    'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>

<div class="excel-form myForm">

	<?php $form = ActiveForm::begin([
		'method' => 'post',
		'action' => 'update?id='.$crtid.'&type='.$type,
		'id' => 'ExcelForm'
	]); ?>

    <?= $this->render($type, [
        'form' => $form,
        'model' => $model,
      	'crtid' => $crtid,
      	// 'pt_model' => isset($pt_model) ? $pt_model : '',
      	'pt_rel_list' => isset($pt_rel_list) ? $pt_rel_list : '',
        'pt_rel' => isset($pt_rel) ? $pt_rel : '',
      	'evaluation_time' => isset($evaluation_time) ? $evaluation_time : ''
    ]) ?>

    <div class="form-group">
		<?= Html::submitButton('更新', ['class' => 'btn btn-primary', 'id' => 'submitButton']) ?>

		<?= Html::a('取消', ['index'], ['class' => 'btn btn-success']) ?>
	</div>

	<?php ActiveForm::end(); ?>

</div>
<?php if ($type == 'et') :?>
<div class="crop-avatar">
    <?= $this->render('@app/views/layouts/media.php') ?>
</div>
<?php endif; ?>
